<template>
  <view :style="colorStyle">
    <block v-if="options.type == 1">
      <image
        src="http://xpj40szpt.signalpha.cn/img/img70.png"
        class="icon"
        mode="widthFix"
      ></image>
      <view class="info1 themeColor f34 tcenter fontWeight"> 支付成功 </view>
      <view class="info2 c8B949D f28 tcenter">
        本单为您优惠{{ options.money }}元
      </view>
      <view class="infobox1 flex aitems between">
        <view class="btn1" @click="goRedirectTo(`/pages/order/list`)">
          查看订单
        </view>
        <view class="btn2" @click="goSwitchTab('/pages/cate/cate')">
          继续逛逛
        </view>
      </view>
    </block>
    <block v-if="options.type == 2">
      <image
        src="http://xpj40szpt.signalpha.cn/img/img71.png"
        class="icon"
        mode="widthFix"
      ></image>
      <view class="info1 cF65B49 f34 tcenter fontWeight"> 支付失败 </view>
      <view class="infobox1 flex aitems jcenter">
        <view class="btn3 cfff" @click="goSwitchTab('/pages/index/index')">
          返回首页
        </view>
      </view>
    </block>
  </view>
</template>

<script>
import {} from "@/servers/servers.js";
import { HTTP_STATUS } from "@/servers/config.js";
import colors from "@/mixins/color";
import { go } from "@/utils/wxAPI.js";
export default {
  mixins: [colors],
  data() {
    return {
      options: {},
    };
  },
  onLoad(options) {
    this.options = options;
  },
  methods: {
    gourl(url) {
      go(url);
    },
    goRedirectTo(url) {
      uni.redirectTo({
        url,
      });
    },
    goSwitchTab(url) {
      uni.switchTab({
        url,
      });
    },
  },
};
</script>
<style>
/* #ifdef MP-WEIXIN */
page {
  background: #fff;
}

/* #endif */
</style>
<style lang="scss" scoped>
page {
  background: #fff;
}

.icon {
  width: 400rpx;
  height: 400rpx;
  margin: 111rpx auto 0;
}

.info1 {
  margin: 62rpx 0 0;
}

.info2 {
  margin: 30rpx 0 0;
}

.infobox1 {
  margin: 80rpx 60rpx 0;

  .btn1 {
    background: var(--view-minorColorT);
    color: var(--view-theme);
    width: 300rpx;
    height: 88rpx;
    border-radius: 60rpx;
    line-height: 88rpx;
    text-align: center;
  }

  .btn2 {
    background: var(--view-theme);
    color: #fff;
    width: 300rpx;
    height: 88rpx;
    border-radius: 60rpx;
    line-height: 88rpx;
    text-align: center;
  }

  .btn3 {
    background: #f65b49;
    width: 480rpx;
    height: 88rpx;
    border-radius: 60rpx;
    line-height: 88rpx;
    text-align: center;
  }
}
</style>
